<include file="Public/header" />
<title>管理员列表</title>
</head>
<body>
	
<div class="pd-20" style="margin-top:-20px;">
	<div class="cl pd-5 bg-1 bk-gray mt-20">
		<form class="formleft" name="" id="" action="__MODULE__/Checkbill/order/" method="get">
			<input class="input-text" style="width:200px" type="hidden" value="<{$_GET['id']}>"  name="id">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['order_no']}>" placeholder="原订单编号" name="order_no">
			<input class="input-text" style="width:200px" type="text" value="<{$_GET['logistics_no']}>" placeholder="运单号" name="logistics_no">
			<button type="submit" class="btn btn-success"><i class="icon-plus"></i> 查询</button>
		</form>
		<span class="r">共有数据：<strong><{$count}></strong> 条</span> 
    </div>
	
	<table class="table table-border table-bordered table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="22">订单列表</th>
			</tr>
			<tr class="text-c">
				<th width="25" class="sorting_disabled" rowspan="1" colspan="1" aria-label="" style="width: 25px;"><input type="checkbox" name=""  value=""></th>
				<th>序号</th>
				<th width="">原订单编号</th>
				<th width="">订单编号</th>
				<th width="">运单号</th>
				<th width="">收件人姓名</th>
				<th width="">身份证号</th>
				<th width="">收件人电话</th>
				<th width="">收件人地址</th>
				<if condition="$warehouse_cate eq 2">
					<th width="">申报单号</th>
					<th width="">是否放行</th>
				</if>
				<th width="">发货状态</th>
				<if condition="$warehouse_cate eq 2">
					<th width="">申报失败原因</th>
				</if>

				<th width="">备注</th>
				<th width="">状态</th>

				<th width="">删单状态</th>
				<th width="">添加时间</th>
				<th width="">操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr class="text-c">
				<td><input type="checkbox" value="<{$vo.id}>" name="" class="ids"></td>
				<td><{$i}></td>
				<td><{$vo.old_order_no}></td>
				<td><{$vo.order_no}></td>
				<td><{$vo.logistics_no}></td>
				<td><{$vo.user_name}></td>
				<td><{$vo.user_idcard}></td>
				<td><{$vo.user_phone}></td>
				<td><{$vo.province}><{$vo.city}><{$vo.area}><{$vo.user_address}></td>
				<if condition="$warehouse_cate eq 2">
					<td><{$vo.apply_order_no}></td>
					<td>
						<if condition="$vo['is_pass'] eq 0">
							失败
						</if>
						<if condition="$vo['is_pass'] eq 1">
							成功
						</if>
					</td>
				</if>
				<td>
					<if condition="$vo['is_delivery'] eq 0">
						未发货
					</if>
					<if condition="$vo['is_delivery'] eq 1">
						已发货
					</if>
				</td>
				<if condition="$warehouse_cate eq 2">
					<td>
						<if condition="$vo['is_pass'] eq 0">
							<{$vo.fail_reason}>
						</if>
					</td>
				</if>

				<td>
					<{$vo.erp_mark_mailno}>
				</td>
				<td>
				<if condition="$vo.flag eq 1">
					<img src="__PUBLIC__/img/flag/flag_green.png">
				</if>
				<if condition="$vo.flag eq 2">
					<img src="__PUBLIC__/img/flag/flag_yellow.png">
					
				</if>
				<if condition="$vo.flag eq 3">
					<img src="__PUBLIC__/img/flag/flag_red.png">
				</if>
				</td>

				<td>
				<if condition="$vo.status eq -1">
					<span style="color:red">已删除</span>
				</if>
				<if condition="$vo.status eq 4">
					<span style="color:red">等待回执</span>
				</if>
				</td>
				<td><{$vo.add_time|date="Y-m-d",###}></td>
				<td>
					<a href="javascript:;" onclick="admin_open('详细','__MODULE__/order/order_detail/id/<{$vo.id}>','<{$vo.id}>','1200','680')" class="">详细</a>
				</td>
			</tr>
			</volist>			
		</tbody>
	</table>
	<div class="page mt" style="text-align:right"><{$page}></div>
</div>
<script type="text/javascript" src="__PUBLIC__/js/jquery.form.js"></script>
<script>
	//支付
	function alipay(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		<!-- console.log(check_val.length); -->
		<!-- return false; -->
		if(check_val.length==0){
			layer.msg("至少选择一个订单");
			return false;
		}else{
			total_fee_url='__MODULE__/order/total_fee/'+Math.random(); //iframe的url
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: total_fee_url,
				success:function(data){
				<!-- console.log(data.status); -->
				<!-- return false; -->
					if(data.status==1){	//检查通过，跳转生成波次单页面
						url='__MODULE__/import/alipay/price/'+data.message+"/ids/"+check_val+"/"+Math.random(); //iframe的url
						var index=layer.open({
							type: 2,
							title: '支付',
							shadeClose: true,
							shade: 0.5,
							area: ['500px', '300px'],
							content: url
						});
					}else{			//检查未通过，刷新页面
						layer.msg("没有金额");
					}
					return false;
				}
			})
		}
		
		
	}
	
	function importexcelAll(){
			url='__MODULE__/import/importPushorder/'+Math.random(); //iframe的url
		
        var index=layer.open({
            type: 2,
            title: '导入数据',
            shadeClose: true,
            shade: 0.5,
            area: ['1000px', '150px'],
            content: url
        });
    }

	function exportExcel(){
		var url="<{:U('Order/order',array('excel'=>1))}>/?1=1";
		
		logistics_no=$('input[name=logistics_no]').val();
		order_no=$('input[name=order_no]').val();
		user_name=$('input[name=user_name]').val();
		user_idcard=$('input[name=user_idcard]').val();
		user_phone=$('input[name=user_phone]').val();
		user_address=$('input[name=user_address]').val();
		
		start_time=$('input[name=start_time]').val();
		end_time=$('input[name=end_time]').val();

		if(logistics_no!=""){
			url=url+"&logistics_no="+logistics_no;
		}
		if(order_no!=""){
			url=url+"&order_no="+order_no;
		}
		if(user_name!=""){
			url=url+"&user_name="+user_name;
		}
		if(user_idcard!=""){
			url=url+"&user_idcard="+user_idcard;
		}
		if(user_phone!=""){
			url=url+"&user_phone="+user_phone;
		}
		if(user_address!=""){
			url=url+"&user_address="+user_address;
		}
		if(start_time!=""){
			url=url+"&start_time="+start_time;
		}
		if(end_time!=""){
			url=url+"&end_time="+end_time;
		}
		window.location.href=url;
	}
	
	function edit_buyer(){
		var option = $(".ids");
		<!-- console.log(option); -->
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts>1){
			layer.msg('一次只能选择一个订单');
			return false;
		}else{
			id=$(".ids:checked").eq(0).val();
			url='__MODULE__/Order/edit_buyer/id/'+id+'/'+Math.random(); //iframe的url
			
			var index=layer.open({
				type: 2,
				title: '编辑购买人',
				shadeClose: true,
				shade: 0.5,
				area: ['800px','150px'],
				content: url
			});
		}
	}
	//推送
	function push(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		<if condition="$importExcelPushorderTempName eq 0">
			url="<{:U('pushoms_normal')}>";	//跨境正常
		</if>
		<if condition="$importExcelPushorderTempName eq 1">
			url="<{:U('pushoms_normal_normal')}>";	//一般正常
		</if>
		<if condition="$importExcelPushorderTempName eq '3-aozhou.xlsx'">
			url="<{:U('pushoms_aozhou')}>";	//跨境定制
		</if>
		
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: url,
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	//再次推送
	function pushtwo(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: "<{:U('pushoms_two')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	function pushselect(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: "<{:U('pushselect')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.message,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.message);
					}
					return false;
				}
			})
		}
	}
	//批量删除
	function delAll(){
		var option = $(".ids");
		var checked_counts=0;
		var check_val = [];
        for(var i=0;i<option.length;i++){
			if(option[i].checked){
				checked_counts++;
				check_val.push(option[i].value);
			}
		}
		if(checked_counts==0){
			layer.msg('请选择内容');
			return false;
		}else{
			$.ajax({
				type: 'POST',
				data: {ids:check_val},
				url: "<{:U('delAll_order')}>",
				success:function(data){
					if(data.status==1){	//检查通过，跳转生成波次单页面
						layer.msg(data.info,function(){
							window.location.reload();
						});
					}else{			//检查未通过，刷新页面
						layer.msg(data.info);
					}
					return false;
				}
			})
		}
	}
</script>
 <include file="Public/footer" />
<include file="Public/footer_js" />
</body>
</html>